<div class="audit-result" *ngIf="auditResult">
    <h4 class="body-title">
        <i class="body-title-icon iconfont icon-pencil-fill"></i>
        <span class="body-title-txt">审核操作</span>

        <div class="spacer"></div>
        <div class="options">
            <nz-select class="option-value" [(ngModel)]="auditResult" (ngModelChange)="auditItemChange($event)"
                style="width: 180px;" [nzDisabled]="auditResult.permissionDenied">
                <nz-option [nzValue]="item" [nzLabel]="item.name" [nzDisabled]="item.permissionDenied" *ngFor="let item of auditItems"></nz-option>
            </nz-select>
        </div>
    </h4>
    <div class="result-wrapper">
        <div class="result-item">
            <span class="result-name">审核结论</span>
            <nz-radio-group [(ngModel)]="auditResult.conclusion" [nzDisabled]="auditResult.permissionDenied" (ngModelChange)="auditResultChanged()">
                <label nz-radio nzValue="pass">通过</label>
                <label nz-radio nzValue="return">退回</label>
                <label nz-radio nzValue="unpass">不通过</label>
            </nz-radio-group>
        </div>
        <div class="result-item" *ngIf="auditResult.conclusion == 'return'">
            <div class="return-item-wrapper">
                <div class="return-item">
                    <span class="result-name">逐级退回</span>
                    <nz-radio-group [(ngModel)]="auditResult.backType" [nzDisabled]="auditResult.permissionDenied">
                        <label nz-radio nzValue="gradually">是</label>
                        <label nz-radio nzValue="appoint">否</label>
                    </nz-radio-group>
                </div>
                <div class="return-item" *ngIf="auditResult.backType === 'appoint'">
                    <span>退回至</span>
                    <nz-select style="width: 180px; margin-left: 20px;" [(ngModel)]="backAuditItemIndex"
                        (ngModelChange)="backAuditItemChange($event)" [nzDisabled]="auditResult.permissionDenied">
                        <nz-option [nzLabel]="item.name" [nzValue]="item.index" *ngFor="let item of canBackAuditItems">
                        </nz-option>
                    </nz-select>
                </div>
            </div>
        </div>
        <div class="result-item">
            <div>
                <span class="result-name">审批意见</span>
                <nz-radio-group [(ngModel)]="auditResult.opinion" [nzDisabled]="auditResult.permissionDenied">
                    <label nz-radio nzValue="no">无审批意见</label>
                    <label nz-radio nzValue="attachment">上传审批附件</label>
                    <label nz-radio nzValue="text">填写审批意见</label>
                </nz-radio-group>

                <div style="margin-top:20px">
                    <ng-container *ngIf="auditResult.opinion == 'text'">
                        <textarea class="full-width" rows="4" nz-input [(ngModel)]="auditResult.opinionValue"
                            [attr.disabled]="auditResult.permissionDenied"></textarea>
                    </ng-container>

                    <ng-container *ngIf="auditResult.opinion == 'attachment'">
                        <nz-upload [nzAction]="uploadService.uploadAction" [nzHeaders]="uploadService.headers"
                            nzName="file" [nzShowUploadList]="false" [nzBeforeUpload]="beforeUpload"
                            (nzChange)="handleChange($event)" [nzDisabled]="auditResult.permissionDenied">
                            <button nz-button>
                                <i class="iconfont icon-upload-2-fill"></i>
                                点击上传
                            </button>
                        </nz-upload>
                    </ng-container>
                </div>
            </div>
            <div></div>
        </div>
    </div>
</div>